<?php

/*
* teia\webdev\php\core\
* Pool of utility types
*
* @author Bernardo Quibiana
* @date created: 20111028
*
* @date modified: 20111028
* @modified: Bernardo Quibiana
*/

// namespace declaration: Types
namespace teia\webdev\php\core;

require_once 'FunctionPool.inc';

class PasswordCheck {
	const __default = self::FAIL;

	const PASS = 0;
	const TOO_SHORT = 1;
	const TOO_LONG = 2;
	const PATTERN_MISMATCH = 3;
	const REPETITION_MISMATCH = 4;
	const FAIL = 5;
}

class DataModel {
	const YAML = 1;
}

class PurchaseStage {
	const AUTHENTICATION = 0;
	const SHIPPING = 1;
	const BILLING = 2;
	const REVIEW = 3;
	const PAYMENT = 4;
	const CONFIRMATION = 5;
	
	static function stage_name($stage, $lang='en') {
		return '';
	}
}
class Image {
	public $name;
	public $src;
	public $alt_txt;
	public $link;
	
	public $width;
	public $height;
	
	public $html_id;
	public $html_class;
	
	function __construct() {
		;
	}
	
	public function display($show_link) {
		echo $this->generate($show_link);
	}
	
	public function generate($show_link) {
		
		$content = $this->generate_img();
		if ($show_link) {
			$content = '<a href="' . $this->link . '">' . $content . '</a>';
		}
		//<img src="img/photos/3.jpg" width="620" height="320" alt="Power Station" >
		return $content;
	}
	
	public function generate_img() {
		$attrib_array = array('src' => $this->src, 'width' => $this->width, 'height' => $this->height, 'alt' => $this->alt_txt);
		$attrib_str = FunctionPool::assoc_to_str($attrib_array);
		
		return "<img $attrib_str />";
	}
}

?>